package com.tc.zookeeper.curator;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.ChildData;

import java.util.List;

public interface EnhancedCuratorFramework extends CuratorFramework {

	/**
	 * watch node's change
	 * 
	 * @param path
	 * @param listener
	 * @return
	 * @throws Exception
	 */
	public byte[] watchNode(String path, EnhancedNodeCacheListener listener) throws Exception;

	/**
	 * watch children nodes' add,remove,update
	 * 
	 * @param path
	 * @param listener
	 * @return
	 * @throws Exception
	 */
	public List<ChildData> watchChildrenNodes(String path, EnhancedPathChildrenCacheListener listener) throws Exception;

	/**
	 * watch children nodes' add,remove
	 * 
	 * @param path
	 * @param listener
	 * @return
	 * @throws Exception
	 */
	public void watchChildrenAddRemove(String path, EnhancedChildrenAddRemoveListener listener) throws Exception;

}
